import java.io.FileWriter;
import java.io.IOException;

/**
 * Created by asus on 2017/5/30.
 */
public class ExpressionGenerator extends SetNum {
    public static void main(String args []) throws IOException{
        if (args.length != 3) {
            System.err.println("java ExpressionGenerator <number-of-expressions> <number-of-operator> <output-file-path>");
            System.exit(1);
        }
        OurAchv a = new OurAchv();
        int expr_num = Integer.parseInt(args[0]);
        int optr_num = Integer.parseInt(args[1]);
        String file_path = args[2];

        StringBuffer expr = new StringBuffer();
        FileWriter fw = new FileWriter(file_path);
        for (int i = 0; i < expr_num; ++i) {


            fw.write(a.project(optr_num));
            fw.write('\n');
            expr.delete(0, expr.length());
        }
        fw.close();

    }
    }

